<template>
    <div class="Mine">
        <div class="mine">
            <div class="mine-head">
                <!--<img src="../../../../assets/img/banner/bgsa.png" class="bg-1" alt="">-->
                <div class="mine-head-content">
                    <div class="newname">
                        <div class="new">
                            <div class="img">
                                <img :src="items.user_info.avatar" alt="">
                            </div>
                            <div class="name">
                                <p>{{items.user_info.nickname}}</p>
                                <p>ID:{{items.vip_code}}</p>
                            </div>
                        </div>
                        <div>
                            <p @click="go('Users')"><i class="iconfont icon-bianji"></i><span>编辑资料</span></p>
                        </div>
                    </div>
                    <div class="state">
                        <div class="state-du">
                            <p>阅读等级</p>
                            <p>{{items.user_info.read_level}}</p>
                        </div>
                        <div class="state-du">
                            <p>阅读文字</p>
                            <p>{{items.user_info.read_words}}</p>
                        </div>
                        <div class="state-du">
                            <p>阅读天数</p>
                            <p>{{items.user_info.read_days}}</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="mine-newcontent">
                <ul class="mine-newcontent-ul">
                    <li class="mine-newcontent-li" @click="go('ComreadAction')">
                        <div>
                            <p style="margin-bottom:.3rem"><i class="iconfont icon-haoyougongdu"></i></p>
                            <div>好友共读</div>
                        </div>
                        <div><span>和好友一起阅读</span><i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" @click="go('wallet')">
                        <div>
                            <p style="margin-bottom:.3rem"><i class="iconfont icon-wodeqianbao"></i></p>
                            <div>我的钱包</div>
                        </div>
                        <div><i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" v-if="false">
                        <div>
                            <!--< img src="../../../../assets/img/icon/mine/icon@8.png" alt="">-->
                            <p style="margin-bottom:.1rem;position: relative;right: 0.05rem"><i
                                    class="iconfont icon-xunzhang"></i></p>
                            <div>我的勋章<i></i></div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" @click="go('Address')" v-if="false">
                        <div>
                            <p><i class="iconfont icon-dizhi1"></i></p>
                            <div>我的地址</div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" @click="go('Reward')">
                        <div>
                            <p><i class="iconfont icon-jiangxuejin" style="font-size: 1.6rem;position: relative"></i>
                            </p>
                            <div>奖学金申请</div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                </ul>
                <ul class="mine-newcontent-ul" v-if="false">
                    <li class="mine-newcontent-li" v-if="false">
                        <div>
                            < img src="../../../../assets/img/icon/mine/icon@2.png" alt="">
                            <div>我的阅读计划</div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" v-if="false">
                        <div>
                            < img src="../../../../assets/img/icon/mine/icon@5.png" alt="">
                            <div>推荐有奖</div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" v-if="false">
                        <div>
                            < img src="../../../../assets/img/icon/mine/icon@3.png" alt="">
                            <div>学习排行</div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                </ul>
                <ul class="mine-newcontent-ul">
                    <li class="mine-newcontent-li" @click="go(PromotionOptin.go)">
                        <div>
                            <p><i class="iconfont icon-tuijianyoujiang"></i></p>
                            <div>{{PromotionOptin.text}}</div>
                        </div>
                        <div>
                            <span v-if="items.use_big_bay==='1'&&items.coupon_desc&&items.coupon_desc1!=='-1'">{{items.coupon_desc}}</span>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" @click="go('TestInfo')" v-if="false">
                        <div>
                            <p><i class="iconfont icon-cihui"></i></p>
                            <div>词汇量测试</div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" @click="go('Remind')">
                        <div>
                            <p><i class="iconfont icon-shezhitixing"></i></p>
                            <div>阅读提醒设置</div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" @click="golink(items.feedback)">
                        <div>
                            <p><i class="iconfont icon-changjianwenti"></i></p>
                            <div>用户反馈</div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                    <li class="mine-newcontent-li" @click="golink(items.manual)">
                        <div>
                            <p><i class="iconfont icon-yonghufankui"></i></p>
                            <div>常见问题</div>
                        </div>
                        <div>
                            <i class="iconfont icon-jinru"></i>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'index',
        data: function () {
            return {
                items: {
                    user_info: {
                        avatar: require('../../../../assets/img/BookShelf/zhang1.png'),
                        nickname: '',
                        read_level: 0,
                        read_words: 0,
                        read_days: 0
                    }
                },
                PromotionOptin: {
                    text: '推荐有奖',
                    go: 'Promotion'
                }
            }
        },
        mounted: function () {
            this.updata(this.$Login.Vip_token)
        },
        methods: {
            updata: function (data) {
                this.$axios.get_user(data).then(res => {
                    // use_big_bay
                    // -1，默认值，没有接入海湾   0也是没有接入
                    // 1 接入海湾
                    // 2 和海湾并行
                    if (res.data.qing_data.use_big_bay === '1') {
                        this.PromotionOptin = {
                            text: '邀请有奖',
                            go: 'NewPromotion'
                        }
                    } else {
                        this.PromotionOptin = {
                            text: '推荐有奖',
                            go: 'Promotion'
                        }
                    }
                    this.items = res.data.qing_data
                    sessionStorage.setItem('Users', JSON.stringify(res.data.qing_data))
                })
            },
            go: function (str) {
                this.$router.push({
                    name: str,
                    query: {}
                })
            },
            golink: function (link) {
                window.location.href = link
            }
        },
        components: {}
    }
</script>

<style scoped>
    @import "../../../../assets/css/components/Home/Mine/index.css";
</style>
